<?php
/**
 * Created by PhpStorm.
 * User: iceberg
 * Date: 2018-10-09
 * Time: 16:18
 */

namespace app\base\controller;


use app\service\ProductService;
use think\Controller;

class Product extends Controller
{
    //商品业务类
    private $productService;

    //初始化类
    public function initialize()
    {
        $this->productService = new ProductService();
    }

    //分页
    public function index()
    {
        $this->assign('list', $this->productService->page());
        $this->assign('count', $this->productService->count());
        return $this->fetch();
    }
}